package com.lh.java.basic.threadlocal;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class LoggingInfoTest {
	/**
	 * 功能描述  
	 * @Author: lh  2012-8-17 下午03:27:44
	 */
	public static void main(String[] args) {
		LoggingInfo logInfo = new LoggingInfo("MIKE", "MECHANICS");   
		System.out.println(logInfo.toString());   
		try  
		{   
		   ObjectOutputStream o = new ObjectOutputStream(   
		                new FileOutputStream("logInfo.txt"));   
		   o.writeObject(logInfo);   
		   o.close();   
		}   
		catch(Exception e) {//deal with exception
			}   
		 
		//To read the object back, we can write   
		  
		try  
		{   
		   ObjectInputStream in =new ObjectInputStream(   
		                new FileInputStream("logInfo.txt"));   
		   LoggingInfo logInfo2 = (LoggingInfo)in.readObject();   
		   System.out.println(logInfo2.toString());   
		}   
		catch(Exception e) {//deal with exception
		}  
		
	}

}
